<template>
	<view>
		测试uniapp中的页面生命周期函数
		<view>
			<button type="primary" @click="refresh">下拉刷新</button>
		</view>
		<view class="boxarr" v-for="item in arrList">
			{{item}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arrList:["java","大数据","嵌入式","前端"]
			}
		},
		methods: {
			refresh(){
				console.log("触发了")
				uni.startPullDownRefresh()
			}
			
		},
		onLoad() {
			console.log("on Load函数触发")
		},
		onShow() {
			console.log("onShow函数触发")
		
		},
		onReady() {
			console.log("onready函数触发")
		},
		onHide() {
			console.log("onHide函数触发")
		},
		onPullDownRefresh() {
			console.log("触发了下拉刷新")
			setTimeout(()=>{
				// this.arrList=["嵌入式","前端","java","大数据"]
				this.arrList=[...this.arrList,...["嵌入式","前端","java","大数据"]]
				uni.stopPullDownRefresh()
			},1000)
			
			
		},
		onReachBottom() {
			console.log("触发了上拉加载事件")
			this.arrList=[...this.arrList,...["嵌入式","前端","java","大数据"]]
		}
		
	}
</script>

<style>
	.boxarr{
		font-size: 20px;
		line-height: 100px;
	}

</style>
